R package
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
top
R packages are extensions to the R statistical programming language. R packages contain code, data, and documentation in a standardised collection format that can be installed by users of R, typically via a centralised software repository such as CRAN (the Comprehensive R Archive Network).cite-ref-rfaq7-29-1-0[1]cite-ref-2[2] The large number of packages available for R, and the ease of installing and using them, has been cited as a major factor driving the widespread adoption of the language in data science.cite-ref-0-3-0[3]cite-ref-4[4]cite-ref-5[5]cite-ref-1-6-0[6]
Compared to libraries in other programming languages, R packages must conform to a relatively strict specification.cite-ref-0-3-1[3] The Writing R Extensions manualcite-ref-7[7] specifies a standard directory structure for R source code, data, documentation, and package metadata, which enables them to be installed and loaded using R's in-built package management tools.cite-ref-0-3-2[3] Packages distributed on CRAN must meet additional standards.cite-ref-0-3-3[3]cite-ref-8[8] According to John Chambers, whilst these requirements "impose considerable demands" on package developers, they improve the usability and long-term stability of packages for end users.cite-ref-0-3-4[3]
Contents
• See also
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Repositories
Comprehensive R Archive Network (CRAN)
The Comprehensive R Archive Network (CRAN) is R's central software repository, supported by the R Foundation.cite-ref-cran-repository-policy-9-0[9] It contains an archive of the latest and previous versions of the R distribution, documentation, and contributed R packages.cite-ref-rfaq2-10-10-0[10] It includes both source packages and pre-compiled binaries for Windows and macOS.cite-ref-11[11] As of November 2020, more than 16,000 packages are available.cite-ref-12[12] CRAN was created by Kurt Hornik and Friedrich Leisch in 1997,cite-ref-13[13]cite-ref-14[14] with the name paralleling other early packing systems such as TeX's CTAN (released 1992) and Perl's CPAN (released 1995).cite-ref-15[15] As of 2021, it is still maintained by Hornik and a team of volunteers.cite-ref-cran-repository-policy-9-1[9] The master site is located at the Vienna University of Economics and Business and is mirrored on servers around the world.cite-ref-rfaq2-10-10-1[10]
The "Task Views" page (subject list) on the CRAN websitecite-ref-crantasks-16-0[16] lists a wide range of tasks (in fields such as finance, genetics, high performance computing, machine learning, medical imaging, meta-analysis, social sciences and spatial statistics) for which R packages are available. Another way to browse CRAN packages is provided by Metacran,cite-ref-metacran-17-0[17] which also maintains lists of featured, most downloaded, trending or most depended upon packages.
The number of CRAN packages has grown exponentially for many years,cite-ref-18[18] and as of 2018 an average of 21 submissions of new or updated packages were made every day.cite-ref-1-6-1[6] Since each submission is manually reviewed by a small team of CRAN maintainers, many of whom, according to R core developer Peter Dalgaard, are "approaching pensionable age", there is a concern that this system is not sustainable in the long term.cite-ref-1-6-2[6] The growth of CRAN has exposed limitations of its dependency management infrastructure, particularly the fact that it assumes that dependencies always refer to the latest version of a package, meaning that new releases of CRAN packages must always be backwards compatible,cite-ref-19[19] and that CRAN packages cannot have dependencies that are not on CRAN.cite-ref-20[20] It has also led to concerns about declining quality of packages.cite-ref-21[21]
MRAN and Posit Package Manager
The Microsoft R Application Network (MRAN) is a mirror of CRAN maintained by Microsoft which is based on the company's downstream distribution of R, Microsoft R Open (formerly Revolution R Open).cite-ref-22[22] It also includes an archive of daily CRAN snapshots, branded as the "CRAN Time Machine", which enables users of MRAN to bypass the dependency versioning limitations of CRAN by installing a fixed set of R package versions via the package checkpoint.cite-ref-23[23]cite-ref-24[24] In January 2023 Microsoft announced that MRAN was being retired and the associated websites and repositories became unavailable in July 2023.cite-ref-25[25]
The Posit Package Manager (formerly RStudio Package Manager) is a similar tool produced by the developers of RStudio which, in addition to CRAN snapshots, includes an archive of R packages from Bioconductor and Python packages from the Python Package Index.cite-ref-rstudio-blog-2020-12-07-26-0[26] It also distributes pre-compiled binary packages for Linux (only Windows and macOS binaries are included on CRAN).cite-ref-27[27]
Other repositories
The Bioconductor project provides R packages for the analysis of genomic data. This includes object-oriented data-handling and analysis tools for data from Affymetrix, cDNA microarray, and next-generation high-throughput sequencing methods.cite-ref-28[28]
R-Forge,cite-ref-29[29] is a central platform for the collaborative development of R packages, R-related software, and projects. R-Forge also hosts many unpublished beta packages, and development versions of CRAN packages.
Base and recommended packages
R is distributed with fifteen "base packages": base, compiler, datasets, grDevices, graphics, grid, methods, parallel, splines, stats, stats4, tcltk, tools, translations, and utils.cite-ref-rfaq5-1-30-0[30]
In addition, there are fifteen "recommended packages" from CRAN which are included with binary distributions of R: KernSmooth, MASS, Matrix, boot, class, cluster, codetools, foreign, lattice, mgcv, nlme, nnet, rpart, spatial, and survival.cite-ref-rfaq5-1-30-1[30]
Other packages
A group of packages called the tidyverse, which can be considered a "dialect of the R language", is increasingly popular in the R ecosystem. As of 1 August 2025, Metacran listed 6 of the 8 core packages of the tidyverse in the list of most downloaded R packages.cite-ref-metacran-17-1[17] The group of packages strives to provide a cohesive collection of functions to deal with common data science tasks, including data import, cleaning, transformation and visualisation (notably with the ggplot2 package).
See also
References
cite-note-rfaq7-29-11. ↑ citerefhornik2020Hornik, Kurt (2020-02-20). "Frequently Asked Questions on R". The Comprehensive R Archive Network. 7.29: What is the difference between package and library?. Archived from the original on 2011-07-09. Retrieved 2 November 2020.{{cite web}}: CS1 maint: location (link)
cite-note-22. ↑ citerefwickhambryanWickham, Hadley; Bryan, Jennifer. "Introduction". R Packages (2nd ed.). Archived from the original on 2022-06-29. Retrieved 2020-11-02.
cite-note-44. ↑ citerefvance2009Vance, Ashlee (2009-01-06). "Data Analysts Captivated by R's Power". New York Times. Archived from the original on 2021-05-02. Retrieved 2020-11-02.
cite-note-77. ↑ "Writing R Extensions". The Comprehensive R Archive Network. Archived from the original on 2020-11-12. Retrieved 2020-11-02.
cite-note-88. ↑ "CRAN Repository Policy". The Comprehensive R Archive Network. Archived from the original on 2020-11-05. Retrieved 2020-11-02.
cite-note-cran-repository-policy-99. ↑ citerefcran-repository-maintainersCRAN Repository Maintainers. "CRAN Repository Policy". The Comprehensive R Archive Network. R Project. Archived from the original on 11 November 2020. Retrieved 20 November 2020.
cite-note-rfaq2-10-1010. ↑ citerefhornik2020Hornik, Kurt (2020-02-20). "Frequently Asked Questions on R". The Comprehensive R Archive Network. 2.1: What is CRAN?: R Project. Archived from the original on 2011-07-09. Retrieved 20 November 2020.{{cite web}}: CS1 maint: location (link)
cite-note-1111. ↑ citerefcran-repository-maintainersCRAN Repository Maintainers. "The Comprehensive R Archive Network". R Project. Archived from the original on 23 January 2019. Retrieved 20 November 2020.
cite-note-1212. ↑ citerefcran-repository-maintainersCRAN Repository Maintainers. "CRAN - Contributed Packages". The Comprehensive R Archive Network. CRAN. Archived from the original on 24 November 2020. Retrieved 20 November 2020.
cite-note-1313. ↑ citerefhornik1997Hornik, Kurt (1997-04-23). "ANNOUNCE: CRAN". r-announce (Mailing list). Archived from the original on 2021-03-08. Retrieved 20 November 2020.
cite-note-1515. ↑ citereffitzgerald2016Fitzgerald, Brian (2016-02-09). "A Survey of Programming Language Package Systems". Some Things Are Obvious. Archived from the original on 2020-11-09. Retrieved 4 May 2021.
cite-note-crantasks-1616. ↑ "CRAN Task Views". cran.r-project.org. Archived from the original on 2011-07-09. Retrieved 2018-09-16.
cite-note-metacran-1717. ↑ "Metacran". Archived from the original on 1 August 2025. Retrieved 1 August 2025.
cite-note-1818. ↑ citerefasay2016Asay, Matt (April 21, 2016). "Exponential growth of R's open source community threatens commercial competitors". TechRepublic. Archived from the original on 2020-10-26. Retrieved 2020-11-02.
cite-note-2020. ↑ citerefdecanmensclaesgrosjean2016Decan, A.; Mens, T.; Claes, M.; Grosjean, P. (2016). "When GitHub Meets CRAN: An Analysis of Inter-Repository Package Dependency Problems". 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER). Vol. 1. pp. 493–504. doi:10.1109/SANER.2016.12. ISBN 978-1-5090-1855-0. S2CID 16751624. Archived from the original on 2021-01-16. Retrieved 2021-05-12.
cite-note-2424. ↑ citerefsmith2019Smith, David (2019-05-22). "MRAN snapshots, and you". Revolutions. Revolution Analytics. Archived from the original on 2021-05-04. Retrieved 4 May 2021.
cite-note-2525. ↑ "Microsoft R Application Network retirement". techcommunity.microsoft.com. Retrieved 2023-11-15.
cite-note-2828. ↑ citerefhubercareygentlemananders2015Huber, W; Carey, VJ; Gentleman, R; Anders, S; Carlson, M; Carvalho, BS; Bravo, HC; Davis, S; Gatto, L; Girke, T; Gottardo, R; Hahne, F; Hansen, KD; Irizarry, RA; Lawrence, M; Love, MI; MacDonald, J; Obenchain, V; Oleś, AK; Pagès, H; Reyes, A; Shannon, P; Smyth, GK; Tenenbaum, D; Waldron, L; Morgan, M (2015). "Orchestrating high-throughput genomic analysis with Bioconductor". Nature Methods. 12 (2). Nature Publishing Group: 115–121. doi:10.1038/nmeth.3252. PMC 4509590. PMID 25633503.
cite-note-2929. ↑ "R-Forge: Welcome". Archived from the original on 2018-09-14. Retrieved 2018-09-16.
cite-note-rfaq5-1-3030. ↑ citerefhornik2020Hornik, Kurt (2020-02-20). "Frequently Asked Questions on R". The Comprehensive R Archive Network. 5.1: Which add-on packages exist for R?. Archived from the original on 2011-07-09. Retrieved 2 November 2020.{{cite web}}: CS1 maint: location (link)
cite-note-3131. ↑ "R infrastructure". R-universe. Retrieved 1 August 2025.
Further reading
• citerefclaesmensgrosjean2014Claes, M.; Mens, T.; Grosjean, P. (2014). "On the maintainability of CRAN packages". 2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE). pp. 308–312. doi:10.1109/CSMR-WCRE.2014.6747183. ISBN 978-1-4799-3752-3. S2CID 17927576.
• citerefdecanmensclaesgrosjean2015Decan, Alexandre; Mens, Tom; Claes, Maelick; Grosjean, Philippe (2015-09-07). "On the Development and Distribution of R Packages". Proceedings of the 2015 European Conference on Software Architecture Workshops. ECSAW '15. Dubrovnik, Cavtat, Croatia: Association for Computing Machinery. pp. 1–6. doi:10.1145/2797433.2797476. ISBN 978-1-4503-3393-1. S2CID 1680582.
External links
• The Comprehensive R Archive Network (CRAN)
• METACRAN, a directory of R packages
• CRAN Task Views, listing of CRAN packages by topics
• Microsoft R Application Network (archived on the Wayback Machine)